<template>
  <el-menu
  :style="{ width: !isCollapse?'230px':'64px'}"
  active-text-color="#ffd04b"
  background-color="#545c64"
  class="aside-container"
  text-color="#fff"
  @open="handleOpen"
  @close="handleClose"
  :collapse="isCollapse"
  :default-active="active">
    <p class="logo-lg">{{isCollapse?'DIDI':'DiDi陪诊'}}</p>
<!--    向子组件传递数据-->
    <TreeMenu :menuData="menuData" :index="1"/>
  </el-menu>
</template>
<script setup>
import TreeMenu from './treeMenu.vue'
import {useRouter} from "vue-router";
import {reactive,computed} from "vue";
import {useStore} from 'vuex'
const store = useStore()
const isCollapse = computed(()=>store.state.menu.isCollapse)
const router = useRouter()
// const menuData = reactive(router.options.routes[0].children)
const menuData = computed(()=>store.state.menu.routerList)
console.log(router,'router')
const handleClose = ()=>{}
const handleOpen = ()=>{}
const active = computed(()=>store.state.menu.menuActive)
</script>
<style lang="less" scoped>
.aside-container {

  // min-width: 230px;
  height: 100%;
  .logo-lg {
    font-size: 20px;
    text-align: center;
    height: 50px;
    line-height: 50px;
    color: #fff;
  }
}
</style>
